import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';

//系统服务和自定义服务
import { HttpModule,JsonpModule,Headers } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { ConfigProvider } from '../providers/config/config';
import { HttpserviesProvider } from '../providers/httpservies/httpservies';
import { StorageProvider } from '../providers/storage/storage';
import { ToolsProvider } from '../providers/tools/tools';

//自定义页面
import { CategoryPage } from '../pages/category/category';
import { CartPage } from '../pages/cart/cart';
import { HomePage } from '../pages/home/home';
import { UserPage } from '../pages/user/user';
import { TabsPage } from '../pages/tabs/tabs';
import { LoginPage } from '../pages/login/login';
import { RegisterPage } from '../pages/register/register';
import { RegisterpwdPage } from '../pages/registerpwd/registerpwd';
import { RegistersignPage } from '../pages/registersign/registersign';
import { SearchPage } from '../pages/search/search';
import { ProductlistPage } from '../pages/productlist/productlist';
import { GoodsdetailPage } from '../pages/goodsdetail/goodsdetail';
import { PersonalPage } from '../pages/personal/personal';
import { OrderPage } from '../pages/order/order';
import { AddressPage } from '../pages/address/address';
import { AddaddressPage } from '../pages/addaddress/addaddress';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

@NgModule({ //根模块
  declarations: [ //声明
    MyApp,
    CategoryPage,
    CartPage,
    HomePage,
    TabsPage,
    UserPage,
    LoginPage,
    RegisterPage,
    RegisterpwdPage,
    RegistersignPage,
    SearchPage,
    ProductlistPage,
    GoodsdetailPage,
    PersonalPage,
    OrderPage,
    AddressPage,
    AddaddressPage,
  ],
  imports: [  //模块的导入
    BrowserModule, //浏览器模块，引入常用内置指令
    HttpModule,
    JsonpModule,
    HttpClientModule,
    IonicModule.forRoot(MyApp,{
      tabsHideOnSubPages: 'true', //隐藏全部子页面 tabs
      backButtonText: '' /*配置返回按钮*/ }
    )
  ],
  bootstrap: [IonicApp], //应用程序的入口
  entryComponents: [
    MyApp,
    CategoryPage,
    CartPage,
    HomePage,
    TabsPage,
    UserPage,
    LoginPage,
    RegisterPage,
    RegisterpwdPage,
    RegistersignPage,
    SearchPage,
    ProductlistPage,
    GoodsdetailPage,
    PersonalPage,
    OrderPage,
    AddressPage,
    AddaddressPage,
  ],
  providers: [//服务
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    ConfigProvider,
    HttpserviesProvider,
    StorageProvider,
    ToolsProvider,
  ]
})
export class AppModule {}
